<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("basePath",basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<title>用户中心</title>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>resources/bootstrap/css/bootstrap-responsive.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>resources/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>resources/css/basic.css">
		
		<script type="text/javascript" src="${basePath}resources/js/common/base.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/angular-1.3.0/angular.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>resources/js/user_center.js"></script>
		<style type="text/css">
			#photo {
				width:50px;
				height:50px;
			}
			#welcome {
				font-size:18px;
			}
		</style>
	</head>
	<body ng-app="myApp" ng-controller="userCenterController">
		<div id="header">
			<%@ include file="common/header.jsp" %>
		</div>
		<div id="container">
			<div><a href="${basePath}user/center">返回个人中心</a></div>
			<c:if test="${examQuestionList != null}">
				<div class="panel panel-default">
					<c:forEach items="${examQuestionList }" var="item">
						<div class="panel-heading">
							<h3 class="panel-title">${item.questionContent}</h3>
							<h3 ng-if="item.imgUrl">
								<img style="width: 80px;height: 80px;" src="${item.imgUrl}" alt="图片">
							</h3>
							<h3>
								<span>正确答案: ${item.questionAnswer}</span> &nbsp;&nbsp;&nbsp;
								<span>您的答案: ${item.userAnswer}</span>  &nbsp;&nbsp;&nbsp;
								<c:if test="${item.isRight == 1}">
									<span style="color: green;">正确</span>
								</c:if>
								<c:if test="${item.isRight == 0}">
									<span style="color: red;">错误</span>
								</c:if>
							</h3>
						</div>
						<div class="panel-body">
				      		<div>
								A : ${item.selectionA}
							</div>
							<div>
								B : ${item.selectionB}
							</div>
							<div>
								C : ${item.selectionC}
							</div>
							<div>
								D : ${item.selectionD}
							</div>
				    	</div>
					</c:forEach>
				</div>
			</c:if>

			<c:if test="${examQuestionList == null}">
				<div>这场考试好像没有交卷啊!</div>
			</c:if>

		</div>
		<div id="footer">
			<%@ include file="common/footer.jsp" %>
		</div>
	</body>
</html>